fix(core): exclude hidden files from glob results - #48894
RRiiiccckkk wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The fix and regression test address the reported issue with no unresolved review comments.
Pull request overview
Fixes glob matching so hidden files are excluded by default while preserving opt-in hidden-file support.
Changes:
- Adds a ripgrep exclusion for hidden paths.
- Adds regression coverage for top-level dotfiles.
File summaries
| File | Summary |
|---|---|
packages/opencode/test/tool/glob.test.ts |
Verifies visible files remain while hidden files are excluded. |
packages/core/src/ripgrep.ts |
Filters hidden paths when hidden matching is disabled. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
d855260 to
6117784
Compare
|
Hi! The latest head is |
Issue for this PR
Closes #47421
Type of change
What does this PR do?
While checking the glob tool with a temporary project, I found that
**/*.tsreturned a top-level.hidden.tseven when hidden files were disabled.Ripgrep allows an explicit glob pattern to match dotfiles unless an exclusion is supplied. The glob adapter now adds
--glob=!**/.*when hidden files are disabled. Callers that passhidden: truekeep the existing behavior.The tool test covers a visible file and a dot-prefixed file and verifies that only the visible file is returned.
How did you verify your code works?
bun test test/tool/glob.test.tsfrompackages/opencode(3 passed).Screenshots / recordings
Not applicable; this change affects filesystem filtering and has no UI changes.
Checklist